import time

from py_po.Base import Base
from selenium.webdriver.common.by import By
class Page(Base):
    # 点击登录
    login_loc=(By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a')
    def login(self):
        self.click(self.login_loc)
    # 会员登录断言
    dy1_loc=(By.XPATH,'/html/body/div[4]/div/div[1]/div[1]/span[1]')
    def dy1(self):
        dy11=self.text(self.dy1_loc)
        print(dy11)
    #   账号输入
    username_loc=(By.NAME,'username')
    def username(self):
        self.send_keys(self.username_loc,'15639757608')
    #  密码输入
    password_loc=(By.NAME,'password')
    def password(self):
        self.send_keys(self.password_loc,'123456')
    # 点击登录
    login_loc1=(By.XPATH,'//*[@id="theForm"]/div[5]/a')
    def login1(self):
        self.click(self.login_loc1)


    def A3mall_serch_01(self):
        self.open_url('http://10.59.9.12:7001/')
        self.login()
        self.dy1()
        print(self.dy1())
        self.username()
        self.password()
        time.sleep(10)
        self.login1()




